﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Com.CodePlex.SPC3.SPbAM.View {

	public partial class CommandParameterDialog : Window {

		public CommandParameterDialog() {
			InitializeComponent();
		}

		private void RunButton_Click(object sender, RoutedEventArgs e) {
			this.DialogResult = true;
		}
	}

	public class CommandParameterTemplateSelector : DataTemplateSelector {
		public DataTemplate StringTemplate { get; set; }
		public DataTemplate BoolTemplate { get; set; }
		public override DataTemplate SelectTemplate(object item, DependencyObject container) {
			ViewModel.CommandParameterViewModel model = (ViewModel.CommandParameterViewModel)item;
			switch (model.Type) {
				case "bool":
					return BoolTemplate;
				default:
					return StringTemplate;
			}		
		}
	}
}
